import 'dart:async';
import 'dart:typed_data';

import 'package:flutter/services.dart';

class Hello {
  static const MethodChannel _channel = const MethodChannel('hello');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  static Future<Uint8List> getNativeImage(int type) async {
    Uint8List data = await _channel.invokeMethod('getNativeImage', {'type': type});
    return data;
  }

  static Future<Map<dynamic, dynamic>> getNativeImagePtr() async {
    Map<dynamic, dynamic> data = await _channel.invokeMethod('getNativeImagePtr');
    return data;
  }

  static Future<Map<dynamic, dynamic>> getBitmapPtr() async {
    Map<dynamic, dynamic> data = await _channel.invokeMethod('getBitmapPtr');
    return data;
  }

  static Future<Null> callCMethod() async {
    await _channel.invokeMethod('callCMethod');
  }

  static Future<Null> threadMethod() async {
    await _channel.invokeMethod('threadMethod');
  }

  static Future<Null> tmpTest() async {
    //临时测试，随时删除
    await _channel.invokeMethod('tmpTest');
  }
}
